/*
 * Copyright (c) 2013 iTAC Software AG, Germany. All Rights Reserved.
 * 
 * This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
 * printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
 * without the written permission of iTAC Software AG.
 */
package org.template.portal;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author rafal.kojta
 */
@Entity
@Table(name = "answer")
public class Answer {

  @Id
  @GeneratedValue(strategy = IDENTITY)
  @Column(name = "ANSWER_ID", unique = true, nullable = false)
  private long answerId;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "QUESTION_ID")
  private Question question;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "STUDENT_ID")
  private Student student;

  @Column(name = "CONTENT")
  private String content;

  @Column(name = "GOOD_VOTE_COUNT")
  private int goodVoteCount;

  @Column(name = "BAD_VOTE_COUNT")
  private int badVoteCount;

  public Answer() {
  }

  public long getAnswerId() {
    return answerId;
  }

  public void setAnswerId(long answerId) {
    this.answerId = answerId;
  }

  public Question getQuestion() {
    return question;
  }

  public void setQuestion(Question question) {
    this.question = question;
  }

  public Student getStudent() {
    return student;
  }

  public void setStudent(Student student) {
    this.student = student;
  }

  public int getGoodVoteCount() {
    return goodVoteCount;
  }

  public void setGoodVoteCount(int goodVoteCount) {
    this.goodVoteCount = goodVoteCount;
  }

  public int getBadVoteCount() {
    return badVoteCount;
  }

  public void setBadVoteCount(int badVoteCount) {
    this.badVoteCount = badVoteCount;
  }

  public String getContent() {
    return content;
  }

  public void setContent(String content) {
    this.content = content;
  }
}
